package com.xiangxiao.rpan.storage.core;

import org.springframework.web.multipart.MultipartFile;

import java.io.*;
/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2023/8/25 11:35
 */
public interface TransferFileByCacheTool {
  /**
   * 从文件将流写入内存或其他介质(用于上传)
   * @param fileInputStream
   * @param outputStream
   */
  void writeFileToStream(FileInputStream fileInputStream, FileOutputStream outputStream);

  /**
   * 传统流对流传输
   * @param inputStream
   * @param outputStream
   */
   void writeStreamToStreamNormal(InputStream inputStream, FileOutputStream outputStream);

  /**
   * MultipartFile分片的文件上传
   */
  String convertMuitlFileToStream(MultipartFile multipartFile, Integer chunkNumber, Integer totalChunks, long blockSize);
}
